package com.flyqiu.flow.boot.events;

import com.alibaba.fastjson2.JSONObject;

import com.flyqiu.flow.event.UserTaskEvent;
import com.flyqiu.flow.event.UserTaskEventContext;
import org.springframework.stereotype.Component;


@Component
public class TestUserTaskEvent implements UserTaskEvent {
    @Override
    public void createBefore(UserTaskEventContext inst) {
        System.out.printf("process:任务:createBefore：%s%n", inst.getElementInstance().getTaskDefName());
    }

    @Override
    public void createAfter(UserTaskEventContext inst) {
        System.out.printf("process:任务:createAfter：%s%n", inst.getElementInstance().getTaskDefName());
    }

    @Override
    public void completeBefore(UserTaskEventContext inst) {
        System.out.printf("process:任务:completeBefore：%s%n", inst.getElementInstance().getTaskDefName());
    }

    @Override
    public void completeAfter(UserTaskEventContext inst) {
        System.out.printf("process:任务:completeAfter：%s%n", inst.getElementInstance().getTaskDefName());
    }


    @Override
    public void deleteBefore(UserTaskEventContext inst, JSONObject params, String reason) {
        System.out.printf("process:任务:deleteBefore：%s%n", inst.getElementInstance().getTaskDefName());
    }

    @Override
    public void deleteAfter(UserTaskEventContext inst, JSONObject params, String reason) {
        System.out.printf("process:任务:deleteAfter：%s%n", inst.getElementInstance().getTaskDefName());
    }
}
